import core.memory;

import std.stdio;

struct AA 
{
    int b;
    ~this()
    {
        writeln("struct AA ~ this");
    }
}


class BB 
{
    int b;
    ~this()
    {
        writeln("class BB ~ this");
    }
}


void main()
{
    AA a;
    BB b = new BB();
    destroy(b);
    if(b is null)
    {
        writeln("--------b is null");
    }
    else
    {
        void * d = cast(void *)b;
        writeln("--------------d is ",d);
    }
    a.destroy;
    writeln("---a == ", a.b);
    
    int * bi = new int;
    
    destroy(bi);
    
    writeln("---bi is ",bi);
}
